package me.xuym.crawler.house58statistics;

import com.cbs.java.component.application.Application;
import com.cbs.java.component.database.Database;
import com.cbs.java.component.database.mysql.MySqlDatabase;
import me.xuym.crawler.Loader;

import java.util.List;

/**
 * Created by broche on 10/09/2017.
 */
public class House58DeltaAddressLoader extends Loader<List<House58DeltaAddress>> {
    private Database database;

    public House58DeltaAddressLoader(Application application) throws Exception {
        super(application);

        database = new MySqlDatabase("home.xuym.me", "3306", "root", "Tomato.14210", "crawler");
    }

    @Override
    protected List<House58DeltaAddress> onLoad() throws Exception {
        return database.query("select address from house58 where address not in (select address from house58address)", House58DeltaAddress.class);
    }
}
